package com.exercise.AndroidCamera;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;

public class WebViewActivity extends Activity{
    WebView webview;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
         
        webview = (WebView)findViewById(R.id.webview);
        webview.setWebViewClient(new WebClient()); 
        WebSettings set = webview.getSettings();
        set.setJavaScriptEnabled(true);
        set.setBuiltInZoomControls(true);
        webview.loadUrl("http://www.google.com");
         
        findViewById(R.id.btnStart).setOnClickListener(onclick);
        
		getActionBar().setTitle("Post Memories");
		getActionBar().setDisplayShowHomeEnabled(false);
    }
     
    OnClickListener onclick =new OnClickListener() {
         
        @Override
        public void onClick(View v) {
            System.out.println("Ŭ��");
            String url= null;
            EditText add = (EditText)findViewById(R.id.add);
            url = add.getText().toString();
            webview.loadUrl(url);           
        }
    };

    class WebClient extends WebViewClient {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    }
}